public class PlayerStateBehavior_PassBall : AbstractPlayerStateBehavior
{
	public static PlayerStateBehavior_PassBall instance;

	private PlayerStateBehavior_PassBall()
	{
	}

	public static PlayerStateBehavior_PassBall getInstance()
	{
		if (instance == null)
		{
			instance = new PlayerStateBehavior_PassBall();
		}
		return instance;
	}

	public override void enter(Player owner)
	{
		base.enter(owner);
		Player player_CatchPass = owner.team.getPlayer_CatchPass(owner);
		owner.LookAt(player_CatchPass.getPosition());
		if ((owner.teamType == TeamType.COMPUTER && UIChooseTeam.comLevel >= 4) || (owner.teamType == TeamType.USER && GameData.TeamLevel[UIChooseTeam.indexInTeamData_User] >= 4))
		{
			if (MathHelper.isInPercent(50f))
			{
				owner.playAnimation(AnimationName.player_pass, 1f, -1f);
			}
			else
			{
				owner.playAnimation(AnimationName.player_pass2, 1f, -1f);
			}
		}
		else
		{
			owner.playAnimation(AnimationName.player_pass, 1f, -1f);
		}
		Instance<Ball>.instance.pass_player_catch_ball = player_CatchPass;
		owner.getBallInHand();
		Instance<Ball>.instance.do_pass(_isRerferPass: false);
		if ((true) && owner.teamType == TeamType.USER)
		{
			Instance<UIGame>.instance.isLockPauseBtn = false;
			Instance<UIGame>.instance.isLockPassBtn = true;
			Instance<UIGame>.instance.isLockShootBtn = true;
			Instance<UIGame>.instance.isLockJoystick = true;
		}
		Instance<AudioController>.instance.play(AudioType.Sound_layup);
	}

	public override void fixedUpdate(Player owner)
	{
		base.fixedUpdate(owner);
		if (!owner.IsPlayingAnimation())
		{
			if (Instance<Ball>.instance.isInSomeOneHand && Instance<Ball>.instance.myTransform.parent == owner.myTransform)
			{
				owner.getBallOutHand();
			}
			if (owner.teamType == TeamType.COMPUTER)
			{
				owner.AI.do_offense_findpos();
			}
			else
			{
				owner.do_idle();
			}
		}
	}

	public override void exit(Player owner)
	{
		base.exit(owner);
		if ((true) && owner.teamType == TeamType.USER)
		{
			Instance<UIGame>.instance.isLockPauseBtn = false;
			Instance<UIGame>.instance.isLockPassBtn = false;
			Instance<UIGame>.instance.isLockShootBtn = false;
			Instance<UIGame>.instance.isLockJoystick = false;
		}
	}
}
